/*
 * @Date: 2022-02-08 19:01:31
 * @Description: grid布局
 */
Component({
    options: {
      addGlobalClass: false,
      virtualHost: false,
    },
    externalClasses: ['custom-class'],
    properties: {
      customStyle: {
        type: String, // 自定义样式
        value: '',
      },
      /** @name 指定每行的列数 */
      cols: {
        type: null,
        value: 1,
      },
      /** @name 指定每行的间隔 */
      xGap: {
        type: null,
        value: '0rpx',
      },
      /** @name 定义每列的间隔 */
      yGap: {
        type: null,
        value: '0rpx',
      },
      /** @name grid-template-columns属性定义每一列的列宽 */
      columns: {
        type: null,
        value: undefined,
      },
    },
    data: {
      gridTemplateColumns: '',
    },
    lifetimes: {
      attached() {
        this.setData({
          gridTemplateColumns: this.data.columns || `repeat(${this.data.cols}, minmax(0px, 1fr))`,
        })
      },
    },
  })
  